package com.rzl.expense.expense.service.impl;

import java.util.List;
import com.rzl.expense.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rzl.expense.expense.mapper.PaymentResourceDetailMapper;
import com.rzl.expense.expense.domain.PaymentResourceDetail;
import com.rzl.expense.expense.service.IPaymentResourceDetailService;

/**
 * 报账时关联资源Service业务层处理
 * 
 * @author expense
 * @date 2024-11-30
 */
@Service
public class PaymentResourceDetailServiceImpl implements IPaymentResourceDetailService 
{
    @Autowired
    private PaymentResourceDetailMapper paymentResourceDetailMapper;

    /**
     * 查询报账时关联资源
     * 
     * @param id 报账时关联资源主键
     * @return 报账时关联资源
     */
    @Override
    public PaymentResourceDetail selectPaymentResourceDetailById(Long id)
    {
        return paymentResourceDetailMapper.selectPaymentResourceDetailById(id);
    }

    /**
     * 查询报账时关联资源列表
     * 
     * @param paymentResourceDetail 报账时关联资源
     * @return 报账时关联资源
     */
    @Override
    public List<PaymentResourceDetail> selectPaymentResourceDetailList(PaymentResourceDetail paymentResourceDetail)
    {
        return paymentResourceDetailMapper.selectPaymentResourceDetailList(paymentResourceDetail);
    }

    /**
     * 新增报账时关联资源
     * 
     * @param paymentResourceDetail 报账时关联资源
     * @return 结果
     */
    @Override
    public int insertPaymentResourceDetail(PaymentResourceDetail paymentResourceDetail)
    {
        paymentResourceDetail.setCreateTime(DateUtils.getNowDate());
        return paymentResourceDetailMapper.insertPaymentResourceDetail(paymentResourceDetail);
    }

    /**
     * 修改报账时关联资源
     * 
     * @param paymentResourceDetail 报账时关联资源
     * @return 结果
     */
    @Override
    public int updatePaymentResourceDetail(PaymentResourceDetail paymentResourceDetail)
    {
        paymentResourceDetail.setUpdateTime(DateUtils.getNowDate());
        return paymentResourceDetailMapper.updatePaymentResourceDetail(paymentResourceDetail);
    }

    /**
     * 批量删除报账时关联资源
     * 
     * @param ids 需要删除的报账时关联资源主键
     * @return 结果
     */
    @Override
    public int deletePaymentResourceDetailByIds(Long[] ids)
    {
        return paymentResourceDetailMapper.deletePaymentResourceDetailByIds(ids);
    }

    /**
     * 删除报账时关联资源信息
     * 
     * @param id 报账时关联资源主键
     * @return 结果
     */
    @Override
    public int deletePaymentResourceDetailByDate(String[] currentDate)
    {
        return paymentResourceDetailMapper.deletePaymentResourceDetailByDate(currentDate[0],currentDate[1]);
    }




    @Override
    public void batchPaymentResourceDetail(List<PaymentResourceDetail> list)
    {

         paymentResourceDetailMapper.batchPaymentResourceDetail(list);
    }


}
